import React, { Component } from 'react'
import { NavLink } from 'react-router-dom'

export default class List extends Component {
  constructor() {
    super()
    this.state = {
      arr: ['apple', 'banana', 'pear']
    }
  }
  render() {
    return (
      <div>
        {
          this.state.arr.map(item=>{
            return (<NavLink key={item} to={'/detail/'+item}>{item}&nbsp;&nbsp;</NavLink>)
          })
        }
      </div>
    )
  }
}
